package cn.xiaoyuan.dao;

import cn.xiaoyuan.entity.AuthUser;
import cn.xiaoyuan.entity.Product;
import cn.xiaoyuan.entity.Sell;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserMapper {

    AuthUser getAuthUserByName(String username);
    int register(@Param("authUser") AuthUser authUser);
    int addrealusers(@Param("uid")int uid, @Param("realName")String realName, @Param("tel")String tel);
    Integer getRoleIdByName(@Param("roleName") String roleName);
    String getRoleNameByRoleId(@Param("roleId") Integer roleId);
    String getTel(String tel);

    //不应该写在这里，但是没有办法
    List<Sell> getSellByUser(int uid);
    int delete_sellId(int id);
    int insertProduct(@Param("product") Product product);
    int insertSeller(@Param("pid") int pid,@Param("uid")int uid);
    int update(@Param("product")Product product);
    Product getProductById(int id);
}
